﻿using System;

namespace DBMock.Builders.Attributes
{
    /// <summary>
    /// 字符串builder特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
    public class StrBuilderAttribute : BaseBuilderAttribute
    {
        /// <summary>
        /// 初始化StrBuilderAttribute
        /// </summary>
        /// <param name="minLength">长度最小值</param>
        /// <param name="maxLength">长度最大值</param>
        /// <param name="chars">字符表</param>
        public StrBuilderAttribute(int minLength = 10, int maxLength = 20,
            string chars = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM")
            : base(typeof(StrBuilder))
        {
            var charArray = chars?.ToCharArray();
            para = new object[] { minLength, maxLength, charArray };
        }
    }
}
